//
//  LSHomelessBeggerInfoTableViewCell.m
//  LaSaCivilAffairsDepartment
//
//  Created by 聂志康 on 2019/1/26.
//  Copyright © 2019 wpkj. All rights reserved.
//

#import "LSHomelessBeggerInfoTableViewCell.h"

@implementation LSHomelessBeggerInfoTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self.contentView addSubview:self.subTitleLabel];
        [self.contentView addSubview:self.mainTitleLabel];
        [self.contentView addSubview:self.subTitleTextView];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    WS
    [self.subTitleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.mainTitleLabel.mas_right).with.offset(12);
        make.right.equalTo(weakSelf.contentView.mas_right).with.offset(-15);
        make.top.equalTo(weakSelf.contentView.mas_top).with.offset(8);
        make.bottom.equalTo(weakSelf.contentView.mas_bottom);
    }];
    [self.subTitleTextView mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.contentView.mas_left).with.offset(12);
        make.top.equalTo(weakSelf.contentView.mas_top).with.offset(LSHomelessBeggerInfoTableViewCellHeight-8);
        make.right.equalTo(weakSelf.contentView.mas_right).with.offset(-12);
        make.bottom.equalTo(weakSelf.contentView.mas_bottom);
    }];
}

- (UILabel *)mainTitleLabel {
    if (!_mainTitleLabel) {
        _mainTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 8+(44-8-15)/2, 100, 44-8)];
        _mainTitleLabel.textColor = hexColor(333333);
        _mainTitleLabel.font = [UIFont fontWithName:@"SourceHanSansCN-Regular" size:14];
    }
    return _mainTitleLabel;
}

- (UILabel *)subTitleLabel {
    if (!_subTitleLabel) {
        _subTitleLabel = [[UILabel alloc] init];
        _subTitleLabel.textColor = hexColor(333333);
        _subTitleLabel.font = [UIFont fontWithName:@"SourceHanSansCN-Regular" size:14];
    }
    return _subTitleLabel;
}

- (UITextView *)subTitleTextView  {
    if (!_subTitleTextView) {
        _subTitleTextView = [[UITextView alloc] init];
        _subTitleTextView.textColor = hexColor(333333);
        _subTitleTextView.font = [UIFont fontWithName:@"SourceHanSansCN-Regular" size:14];
        _subTitleTextView.editable = false;
        _subTitleTextView.userInteractionEnabled = false;
    }
    return _subTitleTextView;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
